package com.scuec.groupfive.mapper;

import com.scuec.groupfive.entity.AnswerRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface AnswerRecordMapper {
    @Select("SELECT * FROM answer_records WHERE user_id = #{userId} AND question_id = #{questionId} ORDER BY answered_at DESC LIMIT 1")
    AnswerRecord selectLatestByUserAndQuestion(@Param("userId") Long userId, @Param("questionId") Long questionId);
} 